﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ClassLibrary.DAO;
using ClassLibrary.Data;
using ClassLibrary.Entity;

public partial class en_ucControl_ucDetail_img : System.Web.UI.UserControl
{
    TblUserGuideDAO UserGuideDAO = new TblUserGuideDAO(Global.CONNECTION_STRING);
    TblLayoutCodeDAO LayoutDAO = new TblLayoutCodeDAO(Global.CONNECTION_STRING);
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            
            LoadListLayout();
            LoadUserGuideByID();

        }
    }

    private void LoadUserGuideByID()
    {
        string idGuide = Request.QueryString["idGuide"];
        TblUserGuide UserGuide = UserGuideDAO.GetUserGuideById(Convert.ToInt32(idGuide));
        lblTitle.Text = UserGuide.Title;
        lblShortDes.Text = UserGuide.ShortDescription;
        lblDetailsDes.Text = UserGuide.DescriptionDetails;
        imgUser.ImageUrl = "~/Admin/img/UserGuide/" + UserGuide.ImageURL;
    }
    private void LoadListLayout()
    {
        reLayout.DataSource = LayoutDAO.ListLayout();
        reLayout.DataBind();
    }

    
}
